package com.jinmdz.fmis.core.model;

import com.jinmdz.fmis.core.annotation.AnAuthorize;

/**
 * @author LiCongLu
 * @date 2019-12-27 16:01
 */
public class HandlerInfo {

    /**
     * 完成映射路径
     */
    private String servletPath;

    /**
     * 类名字
     */
    private String className;

    /**
     * 类映射路径
     */
    private String classPath;

    /**
     * 函数名字
     */
    private String methodName;

    /**
     * 函数映射路径
     */
    private String methodPath;

    /**
     * 函数类型，POST/GET等
     */
    private String methodType;

    /**
     * 类授权注解信息
     */
    private AnAuthorize[] classAuthorizes;

    /**
     * 函数授权注解信息
     */
    private AnAuthorize[] methodAuthorizes;

    public HandlerInfo(String className, String classPath) {
        this.className = className;
        this.classPath = classPath;
    }

    public HandlerInfo(String className, String classPath, String methodName, String methodPath, String methodType) {
        this.className = className;
        this.classPath = classPath;
        this.methodName = methodName;
        this.methodPath = methodPath;
        this.methodType = methodType;
        this.servletPath = this.classPath + this.methodPath;
    }

    public String getServletPath() {
        return servletPath;
    }

    public HandlerInfo setServletPath(String servletPath) {
        this.servletPath = servletPath;
        return this;
    }

    public String getClassName() {
        return className;
    }

    public HandlerInfo setClassName(String className) {
        this.className = className;
        return this;
    }

    public String getClassPath() {
        return classPath;
    }

    public HandlerInfo setClassPath(String classPath) {
        this.classPath = classPath;
        return this;
    }

    public String getMethodName() {
        return methodName;
    }

    public HandlerInfo setMethodName(String methodName) {
        this.methodName = methodName;
        return this;
    }

    public String getMethodPath() {
        return methodPath;
    }

    public HandlerInfo setMethodPath(String methodPath) {
        this.methodPath = methodPath;
        return this;
    }

    public String getMethodType() {
        return methodType;
    }

    public HandlerInfo setMethodType(String methodType) {
        this.methodType = methodType;
        return this;
    }

    public AnAuthorize[] getClassAuthorizes() {
        return classAuthorizes;
    }

    public HandlerInfo setClassAuthorizes(AnAuthorize[] classAuthorizes) {
        this.classAuthorizes = classAuthorizes;
        return this;
    }

    public AnAuthorize[] getMethodAuthorizes() {
        return methodAuthorizes;
    }

    public HandlerInfo setMethodAuthorizes(AnAuthorize[] methodAuthorizes) {
        this.methodAuthorizes = methodAuthorizes;
        return this;
    }
}
